import request from "@/utils/request";
import { getToken } from "@/utils/auth";

export function getZcTreeList(query) {
  return request({
    url: "/hdpc/getZcTree",
    method: "post",
    headers: {
      dataSign: Base64.encode("getNavigationMarkList"),
    },
    data: query,
  });
}

//   目录树列表查询  hdpc/getHdpcData
export function getHdpcData(query) {
  return request({
    url: "/hdpc/getHdpcData",
    headers: {
      dataSign: Base64.encode("getHdpcData"),
    },
    method: "post",
    data: query,
  });
}

// 航标详情   -- 航标
export function getNavigationMarkInfo(query) {
  return request({
    url: "/dataAccess/getNavigationMarkInfo",
    method: "post",
    data: query,
  });
}

// 目录树---航标列表  -- 航标
// export function getNavigationMarkList(query) {
//   return request({
//     url: "/dataAccess/getNavigationMarkList",
//     method: "post",
//     headers: {
//       dataSign: Base64.encode("getNavigationMarkList"),
//     },
//     data: query,
//   });
// }

export function getNavigationMarkList(query) {
  return request({
    url: "/hdpc/getHdpcData",
    headers: {
      dataSign: Base64.encode("getHdpcData"),
    },
    method: "post",
    data: query,
  });
}

// 能源微基站数据  --航标
export function getEnergyBaseStation(query) {
  return request({
    url: "/dataAccess/getEnergyBaseStation?mac=" + query,
    method: "post",
    data: query,
  });
}

// 目录树 --- ais列表数据
export function aisInfoList(query) {
  return request({
    url: "/dataAccess/aisInfoList",
    method: "post",
    data: query,
  });
}

// 船舶巡检. dataAccess/getBoatEquipmentInfo?id
export function getEnergyBaseStationchuanbo(query) {
  return request({
    url: "/dataAccess/getBoatEquipmentInfo?id=" + query,
    method: "post",
    data: query,
  });
}

// 运行监测 --- 视频监控列表
export function getCameraList(query) {
  return request({
    url: "/dataAccess/getCameraList",
    method: "post",
    data: query,
  });
}

// 运行监测 -- 视屏监控总揽
export function getOnlineOfflineCamera(query) {
  return request({
    url: "/dataAccess/getOnlineOfflineCamera",
    method: "post",
    data: query,
  });
}

// 运行监测 运行监测-获取本月每日船舶流量数据
export function getBoatByMonth(query) {
  return request({
    url: "/dataAccess/getBoatByMonth",
    method: "post",
    data: query,
  });
}
// 运行监测-获取近三年的数据
export function getBoatByThreeYears(query) {
  return request({
    url: "/dataAccess/getBoatByThreeYears",
    method: "post",
    data: query,
  });
}
// 运行监测-获取本年每月船舶流量数据
export function getBoatByYear(query) {
  return request({
    url: "/dataAccess/getBoatByYear",
    method: "post",
    data: query,
  });
}
// 运行监测-船舶流量详情接口
export function getBoatHistoryDetail(query) {
  return request({
    url: "/dataAccess/getBoatHistoryDetail",
    method: "post",
    data: query,
  });
}
// 运行监测-船舶流量详情历史记录
export function getBoatHistoryRecord(query) {
  return request({
    url: "/dataAccess/getBoatHistoryRecord",
    method: "post",
    data: query,
  });
}

// 运行监测 - 当日流量统计
export function getBoatByDate(query) {
  return request({
    url:
      "/dataAccess/getBoatByDate?startTime=" +
      query.startTime +
      "&endTime=" +
      query.endTime,
    method: "post",
    data: query,
  });
}

// 运行监测-- 过境记录。dataAccess/getAllBoatHistory
export function getAllBoatHistory(query) {
  return request({
    url: "/dataAccess/getAllBoatHistory",
    method: "get",
    params: query,
  });
}
export function getGateByOnline(query) {
  return request({
    url: "/dataAccess/getGateByOnline",
    method: "post",
    data: query,
  });
}

// 运行监测--环境监测-获取水位站实时水位信息
export function selectSwRealTimeData(query) {
  return request({
    url: "/dataAccess/selectSwRealTimeData",
    method: "post",
    data: query,
  });
}
// 运行监测--环境监测-获取姜堰站和兴化站数据
export function getWorkOrderOverview(query) {
  return request({
    url: "/dataAccess/getWorkOrderOverview",
    method: "post",
    data: query,
  });
}

export function getQxzLiveData(query) {
  return request({
    url: "/dataAccess/getQxzLiveData",
    method: "post",
    data: query,
  });
}

// 运行监测--环境监测-查询预警信息列表
export function selectEarlyWarningList(query) {
  return request({
    url:
      "/dataAccess/selectEarlyWarningList?pageNum=" +
      query.pageNum +
      "&pageSize=" +
      query.pageSize,
    method: "post",
    data: query,
  });
}

// 摄像机拉流  dataAccess/cameraPreviewURLById
export function cameraPreviewURLById(query) {
  return request({
    url: "/dataAccess/cameraPreviewURLById",
    method: "post",
    data: query,
  });
}

// 在线船舶 列表查询  dataAccess/selectAisShipList
export function selectAisShipList(query) {
  return request({
    url: "/dataAccess/selectAisShipList",
    method: "post",
    data: query,
  });
}

// 运行监测 航标-查询航标在线离线数量和各个地区的设备情况 -- /dataAccess/getNavigationMarkOnlineOffline
export function getNavigationMarkOnlineOffline(query) {
  return request({
    url: "/dataAccess/getNavigationMarkOnlineOffline",
    method: "post",
    data: query,
  });
}

// 运行监测  航标监测 异常列表  /dataAccess/getNavigationMarkWarningInfoList
export function getNavigationMarkWarningInfoLis(query) {
  return request({
    url: "/dataAccess/getNavigationMarkWarningInfoList",
    method: "post",
    data: query,
  });
}

// 运行监测 -- 流量监测  dataAccess/getBoatByDate
// export function getBoatByDate(query) {
//   return request({
//     url:
//       "/dataAccess/getBoatByDate?startTime=" +
//       query.startTime +
//       "&endTime=" +
//       query.endTime,
//     method: "post",
//     data: query,
//   });
// }

// 监控云台控制
export function cameraControlling(query) {
  return request({
    url: "/dataAccess/cameraControlling",
    method: "post",
    data: query,
  });
}

// 监控云台 添加预置点
export function camerapresetsAdd(query) {
  return request({
    url: "/dataAccess/camerapresetsAdd",
    method: "post",
    data: query,
  });
}

// 监控云台查询预置点列表
export function camerapresetsList(query) {
  return request({
    url: "/dataAccess/camerapresetsList",
    method: "post",
    data: query,
  });
}

// 预置点删除功能
export function camerapresetsDel(query) {
  return request({
    url: "/dataAccess/camerapresetsDel",
    method: "post",
    data: query,
  });
}

// 当日流量统计弹窗
export function getThisDayLiveData(query) {
  return request({
    url: "/dataAccess/getThisDayLiveData",
    method: "post",
    data: query,
  });
}

// 近七日日流量统计弹窗
export function getBoatSevenDayData(query) {
  return request({
    url: "/dataAccess/getBoatSevenDayData",
    method: "post",
    data: query,
  });
}

// 航标预警  dataAccess/getNavigationMarkWarningInfoList
export function getNavigationMarkWarningInfoList(query) {
  return request({
    url: "/dataAccess/getNavigationMarkWarningInfoList",
    method: "post",
    data: query,
  });
}

// 获取到实时监控列表  dataAccess/cameraPreviewUrlMutl
export function cameraPreviewUrlMutl(query) {
  return request({
    url: "/dataAccess/cameraPreviewUrlMutl",
    method: "post",
    data: query,
  });
}

// 获取到摄像机列表  dataAccess/getCameraGroupList
export function getCameraGroupList(query) {
  return request({
    url: "/dataAccess/getCameraGroupList",
    method: "post",
    data: query,
  });
}

// 工单查询各个警告类型未处理的告警数量
export function selectEarly(query) {
  return request({
    url: "dataAccess/selectEarlyWarningGroupByYjlx",
    method: "post",
    data: query,
  });
}

// 工单接受单位
export function deptTree(query) {
  return request({
    url: "system/user/deptTree",
    method: "get",
    data: query,
  });
}

// 工单派发
export function workOrderAdd(query) {
  return request({
    url: "system/order",
    method: "post",
    data: query,
  });
}
// 工单查看
export function earlyWarning(id) {
  return request({
    url: `/system/order/${id}`,
    method: "get",
  });
}
// 工单流程记录
export function getWorkById(id) {
  return request({
    url: `system/order/getWorkById/${id}`,
    method: "get",
  });
}

// 水位计历年数据 dataAccess/getSwSevenAndLnData
export function getSwSevenAndLnData(query) {
  return request({
    url:
      "dataAccess/getSwSevenAndLnData?swzbm=" +
      query.swzbm +
      "&sjly=" +
      query.sjly +
      "&startYear=" +
      query.startYear +
      "&endYear=" +
      query.endYear,
    method: "post",
    data: query,
  });
}

// 视频回放  /dataAccess/cameraPlaybackURL
export function cameraPlaybackURL(query) {
  return request({
    url: "dataAccess/cameraPlaybackURL",
    method: "post",
    data: query,
  });
}

// 船闸运营概览
// 船舶状态
export function getCzgzSCount(query) {
  return request({
    url: "dataAccess/getCzgzSCount?czdm=" + query.czdm,
    method: "post",
    data: query,
  });
}
// 运营状态
export function getCzgzYyqkCount(query) {
  return request({
    url: "dataAccess/getCzgzYyqkCount?czdm=" + query.czdm,
    method: "post",
    data: query,
  });
}

//过闸船舶类型
export function getCzgzCblxCount(query) {
  return request({
    url: "dataAccess/getCzgzCblxCount?czdm=" + query.czdm,
    method: "post",
    data: query,
  });
}

// 平均通过时间
export function getCzgzPjdzsj(query) {
  return request({
    url: "dataAccess/getCzgzPjdzsj?czdm=" + query.czdm,
    method: "post",
    data: query,
  });
}

// 过闸船舶统计吨位
export function getCzgzDunTj(query) {
  return request({
    url: "dataAccess/getCzgzDunTj?czdm=" + query.czdm + "&type=" + query.type,
    method: "post",
    data: query,
  });
}

// 过闸船舶统计
export function getCzgzCbTj(query) {
  return request({
    url: "dataAccess/getCzgzCbTj?czdm=" + query.czdm + "&type=" + query.type,
    method: "post",
    data: query,
  });
}

// 船闸安全实况
export function getCzaqskTj(query) {
  return request({
    url: "dataAccess/getCzaqskTj?czdm=" + query.czdm,
    method: "post",
    data: query,
  });
}

// 船闸安全实况节点统计
export function getCzaqskJdtj(query) {
  return request({
    url: "dataAccess/getCzaqskJdtj?czdm=" + query.czdm,
    method: "post",
    data: query,
  });
}
// 船闸预警统计
export function getCzaqyjTj(query) {
  return request({
    url: "dataAccess/getCzaqyjTj?czdm=" + query.czdm + "&type=" + query.type,
    method: "post",
    data: query,
  });
}
// 船闸安全异常船
export function getCzaqYccb(query) {
  return request({
    url: "dataAccess/getCzaqYccb?czdm=" + query.czdm + "&type=" + query.type,
    method: "post",
    data: query,
  });
}
// 船闸智能检测
export function czDevPlcLast(query) {
  return request({
    url: `dataAccess/czDevPlcLast`,
    method: "post",
    data: query,
  });
}
// 闸室船舶    待闸区域
export function getLockChamber(query) {
  return request({
    url: "dataAccess/getLockChamber",
    method: "post",
    data: query,
  });
}
// 闸门全过程流量监测
export function zmqgclcjk(query) {
  return request({
    url: "dataAccess/zmqgclcjk",
    method: "post",
    data: query,
  });
}
//船闸异常预警记录
export function qgcselectEarlyWarningList(query) {
  return request({
    url: "dataAccess/getEarlyWarningList",
    method: "post",
    data: query,
  });
}

// 预警详情
export function selectEarlyWarningInfo(query) {
  return request({
    url:
      "dataAccess/selectEarlyWarningInfo?earlyWarningId=" +
      query.earlyWarningId,
    method: "post",
    data: query,
  });
}

// 船闸全过程监测 列表数据 /dataAccess/chuanzhaQgzcj
export function chuanzhaQgzcj(query) {
  return request({
    url: "dataAccess/chuanzhaQgzcj?czdm=" + query.czdm,
    method: "post",
    data: query,
  });
}

// 船艇信息详情
export function selectShipNowByMmsi(query) {
  return request({
    url: "dataAccess/selectShipNowByMmsi",
    method: "post",
    data: query,
  });
}

// 船舶实时监控 /dataAccess/AisToVideo
export function AisToVideo(query) {
  return request({
    url: "dataAccess/AisToVideo",
    method: "post",
    data: query,
  });
}

// // 船舶安全详情

// 修改船舶预警状态 /system/earlyWarning/edit
export function edit(query) {
  return request({
    url: "system/warning/edit",
    method: "post",
    data: query,
  });
}

//预警消息
export function selectEarlyWarningSumByClzt(query) {
  return request({
    url: "dataAccess/selectEarlyWarningSumByClzt",
    method: "post",
    data: query,
  });
}

// 全过程安全预警详情  dataAccess/chuanzhaQgzcjById
export function chuanzhaQgzcjById(query) {
  return request({
    url: "dataAccess/chuanzhaQgzcjById?id=" + query.id,
    method: "post",
    data: query,
  });
}

// 船舶巡检 漫游
export function getRoamingData(query) {
  return request({
    url: "dataAccess/getRoamingData",
    method: "post",
    data: query,
  });
}
// 获取工单总览数据
// export function getWorkOrderOverview(query) {
//   return request({
//     url: "dataAccess/getWorkOrderOverview",
//     method: "post",
//     data: query,
//   });
// }

// -------------------------------------集成流程监控
// 获取工单近12个月的报表数据
export function getSelectWorkByTwelveMonth(query) {
  return request({
    url: "dataAccess/selectWorkByTwelveMonth",
    method: "post",
    data: query,
  });
}
// 获取船闸近12个月的预警类型数据
export function getSelectCzWorkByYjlx(query) {
  return request({
    url: "dataAccess/selectCzWorkByYjlx",
    method: "post",
    data: query,
  });
}
// 养护流程处理情况
export function getYhlcClqk(query) {
  return request({
    url: "dataAccess/getYhlcClqk",
    method: "post",
    data: query,
  });
}
// 获取工单统计数据
export function getWorkOrderZlsj(query) {
  return request({
    url: "dataAccess/getWorkOrderZlsj",
    method: "post",
    data: query,
  });
}
// 获取养护流程统计
export function getYhlctj(query) {
  return request({
    url: "dataAccess/getYhlctj",
    method: "post",
    data: query,
  });
}
// 附属设施运行
export function getFfssyx(query) {
  return request({
    url: "QuanjdataAccess/getFfssyx",
    method: "post",
    data: query,
  });
}
// 全景窗口下载报表
export function getExportHdyxzt(query) {
  return request({
    url: "QuanjdataAccess/exportHdyxzt",
    method: "post",
    data: query,
  });
}
// 船闸监控
export function locksOnOffPreview(query) {
  return request({
    url: "/dataAccess/locksOnOffPreview",
    method: "post",
    data: query,
  });
}
